package com.partvoyage.client.outil;

import com.google.gwt.maps.client.event.MarkerClickHandler;
import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.maps.client.overlay.Marker;
import com.google.gwt.user.client.Window;
import com.partvoyage.shared.GeonameWikiPediaBean;

public class PointWikiPediaSurLaCarte extends Marker {

	private GeonameWikiPediaBean geonameWikiPediaBean;

	public PointWikiPediaSurLaCarte(
			final GeonameWikiPediaBean geonameWikiPediaBean) {
		super(LatLng.newInstance(geonameWikiPediaBean.getLatitude(),
				geonameWikiPediaBean.getLongitude()));
		this.addMarkerClickHandler(new MarkerClickHandler() {
			@Override
			public void onClick(MarkerClickEvent event) {
				Window.open(geonameWikiPediaBean.getWikipediaUrl(), "", "");

			}
		});
		this.setImage(geonameWikiPediaBean.getThumbnailImg());
		this.geonameWikiPediaBean = geonameWikiPediaBean;
	}

	public GeonameWikiPediaBean getGeonameWikiPediaBean() {
		return geonameWikiPediaBean;
	}

	public void setGeonameWikiPediaBean(
			GeonameWikiPediaBean geonameWikiPediaBean) {
		this.geonameWikiPediaBean = geonameWikiPediaBean;
	}

}
